<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<title><%@include
		file="/WEB-INF/jsp/admin/public/projectName.jsp"%></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
<%@include file="/WEB-INF/jsp/admin/public/cssHeader.jsp"%>
<%@include file="/WEB-INF/jsp/admin/public/jsBottom.jsp"%>
</head>
<body class="white-bg">

	<div class="row clearfix col-md-12" style="margin-top: 40px;">
		<div class="wrapper animated pull-right">
			<a id="addRole" href="${pageContext.request.contextPath}/admin/resource/addAdmin.html?roleId=${roleId }" class="btn btn-warning">添加管理员</a>
		</div>
	</div>

	<div class="row white-bg">
		<div class="wrapper wrapper-content animated fadeInRight">
			<div class="container col-md-12 column" style="margin-left: 10px;">
				<div class="wrapper wrapper-content animated fadeInRight row">
					<div class="col-md-12">
						<div>
							<table class="table">
								<thead>
									<tr>
										<th>管理员名称</th>
										<th>管理员账号</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="item" items="${admins }">
										<tr>
											<td>${item.name }</td>
											<td>${item.userName }</td>
											<td class="col-sm-2">
												<a
												href="${pageContext.request.contextPath}/admin/resource/delAdminManager.html?id=${item.id}&roleId=${roleId }"
												class="btn btn-sm btn-danger">删除</a>
												
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>

		</div>
	</div>
</body>
</html>
<c:if test="${message!=null }">
	<script type="text/javascript">
		parent.layer.msg('${message }');
	</script>
</c:if>
<script type="text/javascript">
	$('.editRole')
			.on(
					'click',
					function() {
						var id = $(this).attr("id");
						layer
								.open({
									type : 2,
									title : '添加模块',
									maxmin : true,
									shadeClose : true, //点击遮罩关闭层
									area : [ '250px', '450px' ],
									content : '${pageContext.request.contextPath}/admin/resource/editPrivilege.html?id='+id
								});
					});
</script>

<script type="text/javascript">
	$('#addRes')
			.on(
					'click',
					function() {
						layer
								.open({
									type : 2,
									title : '添加模块',
									maxmin : true,
									shadeClose : true, //点击遮罩关闭层
									area : [ '800px', '450px' ],
									content : '${pageContext.request.contextPath}/admin/resource/addResource.html'
								});
					});
</script>

<script>
	$(document).ready(function() {
		$("#defaultForm").validate({
			rules : {
				chain : {
					url : true
				}
			}
		});
	});

	jQuery.extend(jQuery.validator.messages, {
		required : "请填写本字段",
		remote : "验证失败",
		email : "请输入正确的电子邮件",
		url : "请输入正确的网址",
		date : "请输入正确的日期",
		dateISO : "请输入正确的日期 (ISO).",
		number : "请输入正确的数字",
		digits : "请输入正确的整数",
		creditcard : "请输入正确的信用卡号",
		equalTo : "请再次输入相同的值",
		accept : "请输入指定的后缀名的字符串",
		maxlength : jQuery.validator.format("允许的最大长度为 {0} 个字符"),
		minlength : jQuery.validator.format("允许的最小长度为 {0} 个字符"),
		rangelength : jQuery.validator.format("允许的长度为{0}和{1}之间"),
		range : jQuery.validator.format("请输入介于 {0} 和 {1} 之间的值"),
		max : jQuery.validator.format("请输入一个最大为 {0} 的值"),
		min : jQuery.validator.format("请输入一个最小为 {0} 的值")
	});
</script>
<script type="text/javascript">
	$('.datetimepickeritem').datetimepicker({
		autoclose : true,
		startView : "month",
		minView : "day",
		language : "en"
	});
</script>
